//
//  KDHttpTool.h
//  警用舆情平台
//
//  Created by 魏强 on 15/5/27.
//  Copyright (c) 2015年 魏强. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
@interface KDHttpTool : NSObject
/**
 *  get请求的方法
 *  @param url     网络请求的路径
 *  @param params  需要传入的参数
 *  @param success 请求成功后执行的block
 *  @param failure 请求失败后执行的block
 */
+ (void) get:(NSString *)url parameters:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;
/**
 *  post请求
 */
+ (void) post:(NSString *)url parameters:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;
/**
 *  将json放到body里的那种post
 */
+ (void) post:(NSString *)url bodyJson:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;
/**
 *  上传图片的请求方法
 *  @param imageblock 需要拼接的imageData在这里完成
 */
+ (void) post:(NSString *)url parameters:(NSDictionary *)params constructingBodyWithBlock:(void(^)(id<AFMultipartFormData> formData))imageblock success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;
/**
 *  put
 */
+ (void) put:(NSString *)url parameters:(NSDictionary *)params success:(void (^)(id responseObj))success failure:(void (^)(NSError *error))failure;
@end
